package com.commerceerp.system.service.Impl;

import com.commerceerp.system.entity.SupplierInfo;
import com.commerceerp.system.mapper.SupplierMapper;
import com.commerceerp.system.service.SupplierService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

@Service
public class SupplierServiceImpl implements SupplierService {

    @Autowired
    private SupplierMapper supplierMapper;


    /**
     * 获取所以供应商信息
     */
    @Override
    public List<Map> getAllSupplierInfo(SupplierInfo supplierInfo) {

        List<Map> list = supplierMapper.getAllSupplierInfo(supplierInfo);

        return list;
    }

    @Override
    public Integer saveNewSupplierInfo(SupplierInfo supplierInfo) {

        Integer success = supplierMapper.saveNewSupplierInfo(supplierInfo);

        return success;
    }

    @Override
    public Integer updSupplierInfo(SupplierInfo supplierInfo) {

        Integer success = supplierMapper.updSupplierInfo(supplierInfo);

        return success;
    }

    @Override
    public Integer delSupplierInfo(String supplierId) {

        Integer success = supplierMapper.delSupplierInfo(supplierId);

        return success;
    }

    @Override
    public SupplierInfo getSupplierInfoById(String supplierId) {

        SupplierInfo supplierInfo = supplierMapper.getSupplierInfoById(supplierId);

        return supplierInfo;

    }
}
